#!/bin/bash

# set variables
PROJECT_DIR=$(pwd)
OBJECT=profile_cplus

# create build directory
cd ${PROJECT_DIR}/${OBJECT}
build_folder="build_cplus"
if [ -d "$build_folder" ]; then
    rm -rf "$build_folder"
fi
mkdir "$build_folder"
cd "$build_folder"

# build project
cmake .. 
make -j$(nproc)

# run demo
cd ${PROJECT_DIR}
./${OBJECT}/${build_folder}/profile_cplus